#include "SharedMemory.hpp"
#include "Fifo.hpp"

int main()
{
    FifoHandler writerfifo(false);
    writerfifo.OpenForWrite();

    SharedMemory shm(pathname, projid, USER);
    char *start = (char *)shm.StartMem();

    int index = 0;
    for (char c = 'A'; c <= 'Z'; c++, index += 2)
    {
        sleep(1);
        start[index] = c;
        start[index + 1] = c;
        sleep(1);
        start[index + 2] = 0;

        char ch;
        writerfifo.Wakeup(&ch);
    }

    writerfifo.Close();
    return 0;
}
